<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Yingruan" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1,user-scalable=0" name="viewport" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-title" content="美食+">

<title>美食+</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<script src="../js/jquery.js"></script>
<script>
    var jsonpath = 'http://foodie.imsoftgroup.com/home.php?a=';
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象  
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数  
        if (r != null) {
            return unescape(r[2]);  //返回参数值 
        } else {
            return null;
        }
    }

    //获取cookie
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg))
            return unescape(arr[2]);
        else
            return "null";
    }
    //设置cookie
    function setCookie(name, value, Days) {
        var exp = new Date();
        if (Days > 0) {
            exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
        }
        else {
            exp.setTime(-1);
        }
        document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
    }
</script>
<!--页面内容部调用-->


</head>
<body>
<div class="html-box" >
    <div>
    <div class="login auto-bg" >
        
    </div>
</div>
<Script>
    //设置ajaxhead

    var mem_id = getCookie("yingsoft_home_member_id");

    mem_id == "null" ? mem_id = 0 : 0;
    $.ajax({
        type: "post",
        dataType: "json",
        url: jsonpath + "put_member_login",
        data: {
            shop_id: getUrlParam("shop_id"), shop_table_id: getUrlParam("shop_table_id"), member_id: mem_id
        },
        cache: false,
        success: function (obj) {
            console.log(obj)
            $.each(obj.result, function (v, i) {
                setCookie(v, i, 30);
            })

           
            window.location = "/A-mobile/main/index.html#!/main/root";
        },
        error: function () {
            console.log("接口错误！")
        }
    });


</Script>

</div>



</body>
</html>
